<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>管理系统主页面</title>
<link rel="stylesheet" href="webjars/bootstrap/3.3.7/css/bootstrap.css">
<link rel="stylesheet" href="webjars/bootstrap/3.3.7/css/bootstrap-theme.css">
<link rel="stylesheet" href="webjars/bootstrapvalidator/0.5.3/css/bootstrapValidator.css">
<link rel="stylesheet" href="static/bootstraptable/bootstrap-table.css">
<link rel="stylesheet" href="webjars/jquery.treegrid/0.2.1/css/jquery.treegrid.css">
<script type="text/javascript" src="webjars/jquery/1.11.1/jquery.js"></script>
<script type="text/javascript" src="webjars/bootstrap/3.3.7/js/bootstrap.js"></script>
<script type="text/javascript" src="static/bootstraptable/bootstrap-table.js"></script>
<script type="text/javascript" src="static/bootstraptable/locale/bootstrap-table-zh-CN.js"></script>
<script type="text/javascript" src="static/bootstraptable/extensions/treegrid/bootstrap-table-treegrid.js"></script>
<script type="text/javascript" src="webjars/jquery.treegrid/0.2.1/js/jquery.treegrid.js"></script>
<script type="text/javascript" src="webjars/bootbox/5.4.0/bootbox.all.js"></script>
<script type="text/javascript" src="webjars/bootstrapvalidator/0.5.3/js/bootstrapValidator.js"></script>
<script type="text/javascript" src="webjars/bootstrapvalidator/0.5.3/js/language/zh_CN.js"></script>
<script type="text/javascript" src="static/custom/custom.js"></script>
<script type="text/javascript">
	 $(function(){
       	var n=$('.leftMenu .panel-collapse').length;
		var winHeight=$(window).height();
       	var panelHeight=winHeight-95-n*43;
        	$('#middle').css('height',(winHeight-50-45)+'px'); 
            $(".leftMenu .panel-heading").click(function(e){
                /*切换折叠指示图标*/
                $(this).find("span").toggleClass("glyphicon-chevron-down");
                $(this).find("span").toggleClass("glyphicon-chevron-up");
                
             });
            $('.leftMenu .in').css('height',panelHeight+'px');
            $('.leftMenu .panel-collapse').on('shown.bs.collapse',function(){
            	panelHeight=$(window).height()-95-n*43;
            	$(this).css('height',panelHeight+'px');
            	
            	
             });
            $('.list-group-item .menu-item-left').click(function(){
            	$(".list-group-item .menu-item-left").removeClass("con");
            	$(this).addClass("con");
            	var url=$(this).attr('data-target');
            	$('#mainPanel').loadHtml(url);
            	var obj=document.getElementById('mainPanel');
    			obj.innerHTML=" ";
            });
        });
        $(window).resize(function(){
        	var n=$('.leftMenu .panel-collapse').length;
			var winHeight=$(window).height();
        	var panelHeight=winHeight-95-n*43;
        	$('#middle').css('height',(winHeight-50-45)+'px');
        	$(".in").height(panelHeight);
        	
        });
       
        function changePwd(){
        	$(".list-group-item .menu-item-left").removeClass("con");
        	$('#mainPanel').loadHtml("changePwd");
			
        }
        function xgmm(){
    		$(function(){  		
    				var self=$(this);
    				var dialog=$.createDialog({
    					title:'修改密码',
    					url:'password/edit',
    					buttons:[$.createBtn({
    						iconCls:'fa fa-save',
    						text:'确定',
    						handler:function(){
    							var form=dialog.find('form');
    							var validator=form.data('bootstrapValidator');
    							validator.validate();
    							if(validator.isValid()){
    								self.attr('disabled',true);
    								var fd=form[0];
    								var pwd0=fd.password0.value;
    								var pwd1 = fd.password1.value;    								
    								var pwd2=fd.password2.value;
    								var params=form.serialize();
    								if(pwd0.length==0){
    									bootbox.alert('原密码不能为空！');
    									return;
    								}
    								if(pwd1.length==0){
    									bootbox.alert('密码不能为空！');
    									return;
    								}
    								if(pwd1!=pwd2){
    									bootbox.alert('两次输入密码不一致');
    									return;
    								}else { //输入正确时  
    						        		$.post('password/save',params,function(data){
    											if(data==true){
    												dialog.modal("hide");
    											bootbox.alert('修改成功,三秒后返回登录页面');
    											window.setTimeout("window.location.href='logout'",3000);
    												
    											}
    											if(data==false){
    												bootbox.alert('原密码输入错误！');
    												return;
    											}
    										})	
    						           }
    							
    							}
    						}
    					}),
    						$.createBtn({
    						iconCls:'fa fa-remove',
    						text:'取消',
    						isCloseBtn:true
    					})]
    				}).on('hidden.bs.modal',function(){
    					dialog.remove();
    				})
    				dialog.modal('show');
    			})
    		}
</script>
</head>
<body background="static/images/c17345a23b00d07044d835c193d10a49.jpg" >
	<!-- 页面导航条 -->
   <nav class="navbar navbar-inverse">
     <div class="container-fluid">
       <div class="navbar-header">
         <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
           <span class="icon-bar"></span>
         </button>
         <a class="navbar-brand" href="#">成绩管理系统 <span class="badge">Bootstrap</span></a> 
           <embed src="static/mp/S.E.N.S. - 沉醉于风中.mp3" width="20px" height="20px">
       </div>
       <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">      
         <ul class="nav navbar-nav navbar-right">
           <li><a href="#">欢迎：<span class="text-danger" sec:authentication="principal.name"></span></a></li>
           <li class="dropdown">
             <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户中心 <span class="caret"></span></a>
             <ul class="dropdown-menu">
               <li style="padding-top: 5px"><a id="myDialog" onclick="JavaScript:xgmm()" class="glyphicon glyphicon-wrench" >修改密码</a></li>
               <li style="padding-top: 5px"><a  class="glyphicon glyphicon-off"  href="logout">退出登录</a></button></li>         
             </ul>
           </li>
         </ul>
       </div>
     </div>
   </nav>
   <!-- 左侧菜单 -->
      <div class="container-fluid">
   	   <div class="row">
   		   <div class="col-md-2">
		   	<div class="panel panel-default" style="width:250; height:750px ">
			 <div class="panel-heading" >操作栏</div>
			  <div class="panel-body">	
   			   <div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true" style="width: 200px">
   			     <div class="panel panel-default"sec:authorize="hasRole('ROLE_ADMIN')||hasRole('ROLE_TEACHER')">				 
   			       <div class="panel-heading" role="tab" id="headingOne">
   			         <h4 class="panel-title">
   			           <a role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
   			              <span class="glyphicon glyphicon-list-alt"></span>    成绩管理
   			           </a>
   			         </h4>
   			       </div>
   			       <div id="collapseOne" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
   			         <div class="panel-body">
   						<ul class="nav nav-tabs nav-stacked">
   							<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<a class="menu-item-left " data-target="grade/bjcjgl" id="grade">
										<span class="glyphicon glyphicon-triangle-right" >班级成绩管理</span>
									</a>
								</li>
   							<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<a class="menu-item-left " data-target="grade/grcjgl" id="grade">
										<span class="glyphicon glyphicon-triangle-right">个人成绩管理</span>
									</a>
								</li>
								<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<a class="menu-item-left " data-target="grade/cjcx" id="grade">
										<span class="glyphicon glyphicon-triangle-right">班级成绩查询</span>
									</a>
								</li>							
   						</ul>
   			         </div>
   			       </div>
   			     </div>
   				 
   			     <div class="panel panel-default" sec:authorize="hasRole('ROLE_ADMIN')">
   			       <div class="panel-heading" role="tab" id="headingTwo">
   			         <h4 class="panel-title">
   			           <a class="collapsed" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
   			             <span class="glyphicon glyphicon-home"></span>  系统管理
   			           </a>
   			         </h4>
   			       </div>
   			       <div id="collapseTwo" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingTwo">
   			         <div class="panel-body">
                            <ul class="nav nav-tabs nav-stacked">
								<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<a class="menu-item-left " data-target="banji/manage" id="banji">
										<span class="glyphicon glyphicon-triangle-right">班级管理</span>
									</a>
								</li>
								<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<a class="menu-item-left " data-target="course/manage" id="course">
										<span class="glyphicon glyphicon-triangle-right">课程管理</span>
									</a>
								</li>							
								<!-- <li class="list-group-item">
									利用data-target指定URL
									<a class="menu-item-left " data-target="dept/manage" id="dept">
										<span class="glyphicon glyphicon-triangle-right">部门管理</span>
									</a>
								</li>	 -->						
								<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<a class="menu-item-left " data-target="student/manage" id="student">
										<span class="glyphicon glyphicon-triangle-right">学生管理</span>
									</a>
								</li>	                            
   						   </ul>
   			         </div>
   			       </div>
   			     </div>

							<div class="panel panel-default" sec:authorize="hasRole('ROLE_STUDENT')">
								<div class="panel-heading" role="tab" id="headingOne">
									<h4 class="panel-title">
										<a role="button" data-toggle="collapse"
											data-parent="#accordion" href="#collapseOne"
											aria-expanded="true" aria-controls="collapseOne"> <span
											class="glyphicon glyphicon-list-alt"></span> 成绩管理
										</a>
									</h4>
								</div>
								<div id="collapseOne" class="panel-collapse collapse"
									role="tabpanel" aria-labelledby="headingOne">
									<div class="panel-body">
										<ul class="nav nav-tabs nav-stacked">
										<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<button class="menu-item-left btn btn-default" data-target="grade/grcjcx" id="grade">
										<span class="glyphicon glyphicon-triangle-right">个人成绩查询</span>
									</button>
								</li>   							
								<li class="list-group-item">
									<!-- 利用data-target指定URL -->
									<button class="menu-item-left btn btn-default" data-target="grade/classcx" id="grade">
										<span class="glyphicon glyphicon-triangle-right">学生班级查询</span>
									</button>
								</li>
										</ul>
									</div>
								</div>
							</div>




						</div>
   		   </div>
   		  </div>
		</div>
		   <!-- 页面中心内容 -->
		  <div class="col-md-10" id="mainPanel" style="overflow: auto;background-color:rgba;min-height:800px">	
		  		<table id="mytable1">
				  	 <div class="panel panel-default" style="height: 750px;background-color:#eee">				  	
						<div class="jumbotron">
						  <div >	    
						    <img src="static/images/4.jpg" style="width: 100%;height: 650px" > 
						  </div>
						</div>															
					</div>	
			 	</table>
		   </div>
	   </div>
	</div>
  <!-- 页面底部 -->
   <footer class="navbar-fixed-bottom" style="height: 50px;background-color:rgba">
      <div class="container">
        <p style="text-align: center;padding-top: 13px;font-size: 20px ;color: #FFFFFF" ><b>&copy 湖北三峡职业技术学院</b></p>
      </div>
    </footer>
</body>
</html>